using UnityEngine;
using System.Collections;

public class TrackingObject: LinkableObject {
	public Vector3 directionOfMotion=new Vector3(0,0,0);
	public float movementScaling=1;
	
	// Use this for initialization
	void Start () 
	{
	}
	
	
	public override void reactToTrigger(TriggeredEvent TE)
	{
		if(directionOfMotion!=new Vector3(0,0,0))
		{
			transform.Translate(TE.recentMovement.magnitude*directionOfMotion.normalized*movementScaling);
		}
		else
		{
			transform.Translate(TE.recentMovement*movementScaling);
		}
	}
	
	// Update is called once per frame
	public override void Update ()
	{
		base.Update();
	}
	
	protected override void triggerResponse(TriggeredEvent TE)
	{
		partner.reactToTrigger(TE);
	}
}
